package com.juyu.miliao.authentication.security;

import com.juyu.miliao.common.domain.CommonHead;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;

/**
 * @author wumin
 */
public class AutomaticLogonRegisterToken extends UsernamePasswordAuthenticationToken {
    private static final long serialVersionUID = 1L;
    private String deviceNo;

    private String ip;

    /**
     * 通用请求头
     */
    private CommonHead commonHead;

    public AutomaticLogonRegisterToken(String deviceNo, String ip, CommonHead commonHead) {
        super(null, null);
        if (commonHead == null) {
            throw new RuntimeException("commonHead can`t be null");
        }
        this.deviceNo = deviceNo;
        this.ip = ip;
        this.commonHead = commonHead;
    }

    public String getDeviceNo() {
        return deviceNo;
    }

    public String getIp() {
        return ip;
    }

    public CommonHead getCommonHead() {
        return commonHead;
    }
}
